1. Field of the Invention
The present invention relates to techniques of interpolating color components in pixels of image data.
2. Description of the Related Art
Digital cameras, which are now widespread, generally obtain a first set of image data, in which R (red) component pixel signals, G (green) component pixel signals, and B (blue) component pixel signals, are lined up in a Bayer arrangement, using photo-electric conversion. Then a second set of image data is obtained by executing on the first set of image data processes such as for example pixel interpolation processing, in which color components of pixels are interpolated, magnification chromatic aberration correction processing, in which chromatic differences of magnification are corrected, and distortion aberration correction processing, in which distortion aberration is corrected. This second set of image data is used for such purposes as display on a PC (personal computer) or the like.
Here it is known that the quality of the second set of image data varies depending on the manner in which the above-mentioned pixel interpolation and correction processes are carried out. Accordingly, pixel interpolation processing has been proposed (see Japanese Patent Laid-Open No. 2002-191053) that gives consideration to the reproducibility of high frequency components in order to improve the quality of the second set of image data. Furthermore, it is also known (see Japanese Patent Laid-Open No. 2002-190979) that pixel interpolation processing is to be carried out before magnification chromatic aberration correction processing.
A method of interpolating G components in pixel interpolation processing is described with reference to FIG. 2. As shown in FIG. 2, in image data obtained by an image sensor, R component pixel signals, G component pixel signals, and B component pixel signals are lined up in a Bayer arrangement. Here, since only a B component is present at a pixel 209 of a center in FIG. 2, a G component of the pixel 209 is interpolated based on surrounding G components in order to obtain a G component of the pixel 209.
At this time, a correlation of B components at two pixels above and two pixels below (a pixel 202 and pixel 204) from the pixel 209 (the pixel targeted for interpolation) and a correlation of B components at two pixels right and two pixels left (a pixel 206 and pixel 208) from the pixel 209 are compared. Then, a G component of the pixel 209 is interpolated based on the G component one pixel above and one pixel below or one pixel right and one pixel left (a pixel 201 and pixel 203, or a pixel 205 and pixel 207, respectively) in the direction having higher correlation from the pixel 209. In this way, by determining the pixels of G components to be used in pixel interpolation processing based on a result of comparing a correlation between color components, the reproducibility of high frequency components can be improved for G components and image quality can be improved.
Here, although the image quality of the second set of image data varies depending on the manner in which pixel interpolation and correction processes are carried out as described above, conventionally pixel interpolation processing has been carried out for each of the RGB components of the image data before magnification chromatic aberration correction processing.
However, due to chromatic differences of magnification in image data prior to magnification chromatic aberration correction processing being carried out, the positional relationship between different color components sometimes may not correspond correctly to the positional relationship of the color components of the object. Thus, when pixel interpolation processing is carried out under these conditions, the pixel interpolation processing is carried out based on unsuitable pixels, and there is a problem of reduced image quality in the image data that is obtained.
For example, the pixel 205 and pixel 206 are laterally adjacent in the example of FIG. 2, but since their color components are different, there is a possibility that the positions are displaced due to magnification chromatic aberration, and these may not necessarily be representing laterally adjacent pixels in the object. For this reason, determining the pixels to be used in interpolation processing for the G component of the pixel 209 based on a result of comparing a correlation between B components in the pixel 202 and pixel 204 and the correlation between B components in the pixel 206 and pixel 208 will not always result in improved image quality.
The present invention has been devised in light of these circumstances, and is characterized by providing a technique that improves the quality of image data obtained as a result of image processing in image processing that includes at least pixel interpolation processing and magnification chromatic aberration correction processing.